package com.nb.cloud.doc.controller;

import cn.hutool.extra.pinyin.PinyinUtil;
import com.nb.cloud.doc.biz.ISuggestBiz;
import com.nb.cloud.doc.entity.SysKeyword;
import com.nb.cloud.doc.model.Result;
import com.nb.cloud.doc.model.vo.SuggestVO;
import com.nb.cloud.doc.service.ISysKeywordService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * <p>
 * 搜索 前端控制器
 * </p>
 *
 * @author 作者
 * @since 2024-08-04
 */
@RestController
@RequestMapping("/init/")
public class InitDataController {

    @Autowired
    ISysKeywordService sysKeywordService;

    @GetMapping("/suggest/initKeyword")
    public Result<List<SuggestVO>> initKeyword(){
        sysKeywordService.intToDB();
        return Result.OK();
    }

    @GetMapping("/suggest/initES")
    public Result<List<SuggestVO>> initES(){
        sysKeywordService.initToES();
        return Result.OK();
    }










}
